home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Supervisor's Toolkit
/
Network Supervisor's Toolkit.iso
/
patches
/
_winfile
/
lw42w2
/
installr.bat
< prev
next >
Wrap
DOS Batch File
|
1996-07-10
|
5KB
|
194 lines
@echo off
rem $Id: installr.bat 1.4 95/03/28 15:40:19 frotz Exp $
rem $Source: h:/prod/lwp/patches/rcs/installr.bat $
rem $Locker: $
rem
rem Specify which patch name and which signature file here:
rem
set _mod=LW42W
set _rev=2
set _file=lwpcon.exe
set _r=n
rem
echo.
echo. %0: LAN WorkPlace for DOS 4.2 and 4.1 patch installer: %_mod% (Rev %_rev%)
echo. (C) Copyright 1995 Novell, Inc. All Rights Reserved.
echo.
:MAIN
rem
rem WARNING: This must be invoked from the current directory.
rem
set ME=%0
set usage=%me% [/h] [/p] [/r] [/d dir]
if (%_r%)==(y) set usage=%me% [/h] [/p] [/r] /d dir
if (%_r%)==(y) if (%1)==() goto USAGE
if (%1)==(-h) goto USAGE
if (%1)==(-H) goto USAGE
if (%1)==(/h) goto USAGE
if (%1)==(/H) goto USAGE
if (%1)==(/?) goto USAGE
if (%1)==(-?) goto USAGE
if (%1)==(-p) set install_opt=/P
if (%1)==(/p) set install_opt=/P
if (%1)==(-P) set install_opt=/P
if (%1)==(/P) set install_opt=/P
if (%1)==(-p) shift
if (%1)==(/p) shift
if (%1)==(-P) shift
if (%1)==(/P) shift
if (%1)==(/d) set dir=%2
if (%1)==(-d) set dir=%2
if (%1)==(/D) set dir=%2
if (%1)==(-D) set dir=%2
if (%1)==(/r) set _readme=more
if (%1)==(-r) set _readme=more
if (%1)==(/R) set _readme=more
if (%1)==(-R) set _readme=more
if (%_r%)==(y) goto INSTALL
if not exist which.exe goto USAGE
goto INSTALL
:USAGE
echo.
echo. %me% usage:
echo. %usage%
echo.
echo. where:
echo. /h Displays this information.
echo. /r View the %_mod%.TXT file after installing.
echo. /p Prompts user before adding/replacing each file.
echo. dir Optionally specifies the directory to be upgraded.
echo.
echo. NOTE: This batch file requires the DOS command REPLACE.EXE.
if (%_r%)==(y) goto WARNING
echo. The command WHICH.EXE will attempt to find the correct directory
echo. and MUST be in the current directory.
echo.
:WARNING
echo. WARNING: This batch file requires an environment size of 1024 or more.
echo. Add this line to CONFIG.SYS to ensure proper execution.
echo. SHELL=C:\MSDOS\6\COMMAND.COM C:\ /E:2048 /P
echo.
goto end
:INSTALL
echo. WARNING: This installation batch file expects to install into
echo. the normal directory tree for this product.
echo.
echo. If this installation fails, apply each file by hand.
echo. SHELL=C:\MSDOS\COMMAND.COM C:\ /E:2048 /P is highly recommended.
pause
if (%dir%)==() goto APPLY
set old_path=%path%
if not (%old_path%)==(%path%) goto ERROR1
set path=%dir%;%path%
echo. %me%: PATH temporarily forced to %path%.
goto APPLY
:ERROR1
echo. %me% FATAL ERROR. Out of environment space.
goto USAGE
:APPLY
rem
rem 1) Find which directory and create a batch file...
rem
set _tmp=%temp%
if (%_tmp%)==() set _tmp=c:
which /b %_tmp%\ptch_tmp.bat %_file%
echo.
rem
rem 2) Invoke that batch file to find the target directory.
rem Stored in the Environment Variable: _TMP_PATH_.
rem
if exist %_tmp%\ptch_tmp.bat call %_tmp%\ptch_tmp.bat
if exist %_tmp%\ptch_tmp.bat del %_tmp%\ptch_tmp.bat
set _tmp=.
if exist %_tmp%\ptch_tmp.bat call %_tmp%\ptch_tmp.bat
if exist %_tmp%\ptch_tmp.bat del %_tmp%\ptch_tmp.bat
set _tmp=
rem
rem 3) Now add any missing files.
rem
cd .
echo. %me%: Updating %_tmp_path_%
replace /u %install_opt% *.* %_tmp_path_%
replace /a %install_opt% *.* %_tmp_path_%
cd .
rem
rem 4) Don't copy the PATCH compressed file. Go back and delete it.
rem
echo. %me%: REPLACE copied the self-extract patch file. Now undoing that...
if exist %_tmp_path_%\%_mod%.exe attrib -r %_tmp_path_%\%_mod%.exe
if exist %_tmp_path_%\%_mod%.zip attrib -r %_tmp_path_%\%_mod%.zip
if exist %_tmp_path_%\%_mod%.exe del %_tmp_path_%\%_mod%.exe
if exist %_tmp_path_%\%_mod%.zip del %_tmp_path_%\%_mod%.zip
rem
rem Remove local files that will never appear in the field...
rem
if exist %_tmp_path_%\0index.htm attrib -r %_tmp_path_%\0index.htm
if exist %_tmp_path_%\0index.txt attrib -r %_tmp_path_%\0index.txt
if exist %_tmp_path_%\0index.stp attrib -r %_tmp_path_%\0index.stp
if exist %_tmp_path_%\0index.lst attrib -r %_tmp_path_%\0index.lst
if exist %_tmp_path_%\0index.htm del %_tmp_path_%\0index.htm
if exist %_tmp_path_%\0index.txt del %_tmp_path_%\0index.txt
if exist %_tmp_path_%\0index.stp del %_tmp_path_%\0index.stp
if exist %_tmp_path_%\0index.lst del %_tmp_path_%\0index.lst
rem
rem 5) Clean up...
rem
if not (%dir%)==() set path=%old_path%
if not (%dir%)==() echo. %me%: PATH reset to %path%.
echo. %me%: %_mod% installation completed.
echo. %me%: NOTE: National language files not installed.
DIR .\LANG
rem
rem 6) Now read the README...
rem NOTE: MORE must be on the path.
rem
if (%_readme%)==() goto END
more < %_mod%.TXT
goto END
:end
set _tmp_path_=
set osver=
set dir=
set old_path=
set me=
set install_opt=
set _mod=
set _file=
set usage=
set _r=
set _readme=
set _rev=